package com.wlstock.funi.model;


import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import com.wlstock.funi.app.FundApplication;
import com.wlstock.funi.constant.SharePrefConstants;
import com.wlstock.funi.utils.SharePreferenceUtils;

import java.util.Date;

@DatabaseTable
public class SelfFundSetModel extends BaseModel{
	public static final int PENDING = 1;
	public static final int DONE    = 0;
	
	public static final int ANY_PRICE   = 999;
	public static final int OPEN_PRICE  = 888;
	public static final int CLOSE_PRICE = 777;
	
	
	@DatabaseField(generatedId = true)
	private int id ;
	@DatabaseField
	private String stkNo;
	@DatabaseField
	private String stkName;
	
	@DatabaseField
	private Date  startDay;
	@DatabaseField
	private Date  endDay;
	@DatabaseField
	private String  startTime;
	@DatabaseField
	private String  endTime;
	@DatabaseField
	private int pending;
	
	@DatabaseField
	private Date createDate;
	@DatabaseField
	private float price;
	@DatabaseField
	private float precent;
	@DatabaseField //设置默认值
	private int tradeType = -1;
	@DatabaseField
	private long totalMoney ;
	@DatabaseField
	private boolean quickBuy = true;

	
	public String getStkNo() {
		return stkNo;
	}

	public void setStkNo(String stkNo) {
		this.stkNo = stkNo;
	}

	public String getStkName() {
		return stkName;
	}

	public void setStkName(String stkName) {
		this.stkName = stkName;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getStartDay() {
		return startDay;
	}

	public void setStartDay(Date startDay) {
		this.startDay = startDay;
	}

	public Date getEndDay() {
		return endDay;
	}

	public void setEndDay(Date endDay) {
		this.endDay = endDay;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public float getPrecent() {
		return precent;
	}

	public void setPrecent(float precent) {
		this.precent = precent;
	}

	public int getTradeType() {
		return tradeType;
	}

	public void setTradeType(int tradeType) {
		this.tradeType = tradeType;
	}

	public int getPending() {
		return pending;
	}

	public void setPending(int pending) {
		this.pending = pending;
	}

	public long getTotalMoney() {
		if (totalMoney==0) {
			return (long) SharePreferenceUtils.getFloatSP(FundApplication.getInstance(), SharePrefConstants.DEFAULT_MONEY,5000);
		}
		return totalMoney;
	}

	public void setTotalMoney(long totalMoney) {
		this.totalMoney = totalMoney;
	}

	public boolean isQuickBuy() {
		return quickBuy;
	}

	public void setQuickBuy(boolean quickBuy) {
		this.quickBuy = quickBuy;
	}
}
